#include <iostream>
using namespace std;

void ceshi1(){
    cout << "ceshi 1111" << endl;
}
void ceshi2(int a, int b  = 1){
    cout << a + b << endl;
}
void ceshi3(const int a){
    cout << "a = " << a << endl;
}
void jiaohuan(int* a , int* b){
    int temp = *a;
    *a = *b;
    *b = temp;
}
void bianli(int arr[], int len){
    for (int i = 0; i < len; i++)
    {
        cout << arr[i] << " ";    
    }
    cout << endl;
}


int* fanhui(){
    // 编译报错address of local variable 'a' returned 
    // 因为局部变量地址被回收
    int a = 10086;
    return &a;
}
int main(){
    ceshi1();

    ceshi2(22);

    int x = 13;
    int y = 7;
    cout << "before x=" << x << ", y="<<y<<endl;
    jiaohuan(&x,&y);
    cout << "after x=" << x << ", y="<<y<<endl;

    int arr[] = {1,2,3,4,5};
    bianli(arr,sizeof(arr)/sizeof(int));

    return 0;
}



